Repository navigation
fix(interpreter): close Oils tilde, patsub, brace, loop and paren-ambiguity gaps - #2643
Merged
Merged
Conversation
…iguity gaps
Tilde expansion follows bash's rules: only unquoted prefixes ending in the
same literal expand; assignments expand after = and each : (also name=
arguments); ${x:-~} operands expand unquoted, pattern operands always.
~root and the sandbox user resolve; other users stay literal.
${x/pat/rep} replacements are literal after quote removal; ${x////c} and
${x///} take / as the pattern. Bracket expressions honor \- and treat
reversed ranges as empty; [bin; ends at the metacharacter.
((cmd) ...) and $((cmd) ...) parse as subshells; `(cmd)` is not $((.
while break leaves the loop, (continue) in a loop only warns, continue 1 2
abandons the line. {{a,b} and zero-step ranges expand like bash. Unset
${v@Q}/@K/@A expand to nothing; set -u rejects them; ${!p@} lists arrays.
Oils spec pass rate 77.3% to 78.8%.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 8645536 | Commit Preview URL Branch Preview URL |
Oct 08 2026, 01:40 PM |
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
~whose prefix ends at/or:expands (~"/b",\~,~$vstay literal); assignments expand after=and each:(PATH=a:~/bin), also forname=arguments;${x:-~}expands only unquoted. No user database:~root→/root,~<sandbox user>→/home/<user>.${x/pat/rep}: replacement is literal after quote removal (${v/x/"?"}printed\?x);${x////c}takes/as the pattern.[C\-D]holds a literal-; reversed ranges[z-a]match nothing.echo [bin; echo xno longer reads past the;.((cmd) ...)/$((cmd) ...)parse as nested subshell / command substitution like bash.while break; doleaves the loop;( continue )only warns;continue 1 2is "too many arguments".{stays literal while later groups expand ({{a,b}→{a {b); step 0 counts as 1.${v@op}:${undef@Q}etc. expand to nothing,set -urejects it,${x@K}quotes a scalar.Why
Level-up roadmap: next batch from the Oils harness ranking.
Before / After (verified)
Side gains: command-sub 2 → 0, builtin-eval-source 7 → 5. One case flips (background "Wait for job and PIPESTATUS"): bashkit gives the same output before and after; the old run counted it only because real bash's result for it is racy.
Spot check, identical in bash 5.2 and this branch:
Risk
depth_32_no_stack_overflow: ~1,888,007 bytes vs 1,892,032 on the base; no new awaits in hot paths.${!ref}, owned elsewhere), bash's brace "double expansion" quirk, command-name globbing (would add an await to the hot path),globskipdots,LC_ALL=Cbyte matching. Recorded in limitations.Checklist
Generated by Claude Code